﻿using DX;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Tools.Plugins.IconConver.ViewModels;

namespace Tools.Plugins.IconConver.Views
{
    public partial class ReadIconViewControl : ViewControl
    {
        public ReadIconViewControl()
        {
            InitializeComponent();
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex == -1 || this.ViewModel == null)
            {
                return;
            }
            if (this.ViewModel is ReadIconViewModel viewModel)
            {
                var entity = viewModel.Imgs[e.RowIndex];
                this.pictureBox1.Image = entity.GetImage();
            }
        }
    }
}
